import Mock from 'mockjs';
import loginApi from "@/url/logReg"

const data = Mock.mock({
  'items|30': [
    {
      id: '@id',
      title: '@sentence(10, 20)',
      account: '@phone',
      true_name: '@name',
      created_at: '@datetime',
      role_name: '@name',
    },
  ],
});

export default [
  {
    url: '/table/list',
    method: 'get',
    response: () => {
      const items = data.items;
      return {
        code: 0,
        result: {
          total: items.length,
          list: items,
        },
      };
    },
  },
  {
    url: loginApi.url,
    method: loginApi.method,
    response: () => {
      return {
        code: 0,
        data: {
          url: loginApi.url,
          message: 'success'
        },
      };
    },
  }
];